package com.authService.convert;
import com.authService.entity.SysMenuEntity;
import com.authService.pojo.req.MenuEditReqDTO;
import com.authService.pojo.res.MenuDetailResDTO;
import com.authService.pojo.res.MenuResDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface MenuConvert {

    public static final MenuConvert INSTANCE = Mappers.getMapper(MenuConvert.class);

    /**
     * 列表/分页响应体 Entity 转 DTO
     * @param list
     * @return
     */
    List<MenuResDTO> menuResConvert(List<SysMenuEntity> list);

    /**
     * 详情响应体 Entity 转 DTO
     * @param sysMenuEntity
     * @return
     */
    MenuDetailResDTO detailConvert(SysMenuEntity sysMenuEntity);

    /**
     * 保存请求参数 DTO 转 Entity
     * @param reqDTO
     * @return
     */
    SysMenuEntity editReqDTOConvert(MenuEditReqDTO reqDTO);

}
